import { BasicDetailModel } from '../model/baseModel';
import { defHttp } from '/@/utils/http/axios';

enum Api {
  PageApi = '/sys/api/page',
  GetApiDoctTreeApi = '/sys/api/tree',
  DetailApi = '/sys/api/detail',
}

/**
 * @description: 获取接口文档树
 */
export const getApiDocTree = () => {
  return defHttp.post({ url: Api.GetApiDoctTreeApi });
};

/**
 * 获取接口详细信息
 * @param id {@link string} 文档主键
 * @returns 
 */
export const getApiDocDetail = (id: string) => {
  const data: BasicDetailModel = {
    id: id
  };
  return defHttp.post({ url: Api.DetailApi, data });
};
